﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
using ISFProject.Models.Competition;

namespace ISFProject.Models
{
    public class Result
    {   
        [Key]
        public int ResultId { get; set; }
        [Required(ErrorMessage = "fill in event result")]
        [Range(1,20)]
        public int EventResult { get; set; }
         [Required(ErrorMessage = "fill in is its for school cup or not")]
        public bool IsSchoolCupResult { get; set; }

        [ForeignKey("Meeting")]
        public int MeetingId { get; set; }
        [ForeignKey("Event")]
        public int EventId { get; set; }
        public virtual EventMeeting EventMeeting { get; set; }

        public virtual List<Record> Records { get; set; }

        public int StudentId { get; set; }
        public virtual Student Student { get; set; }

    }
}